import axios from 'axios';
axios.defaults.withCredentials = true;

//线下
// let address = "/api/"
//线上
let address = "https://view.dupont-ex.com/KYApi/"

//ld----------------------------------
// 商品列表
export const infosGoodsGetlist = params => { return axios.get(`${address}/infos/goods/getlist`, { params: params }).then(res => res) };
//建仓
export const tradesPositionOpen = params => { return axios.post(`${address}/trades/position/open`, params).then(res => res) };
// 标的列表
export const infosKindsGetlist = params => { return axios.post(`${address}/infos/kinds/getlist`, params).then(res => res) };
//当前持仓列表
export const tradesPositionGetlist = params => { return axios.post(`${address}/trades/position/getlist`, params).then(res => res) };

 


//hq------------------------------------
export const getvcode = params => { return axios.post(`${address}/customers/regist/getvcode`, params).then(res => res)  }; //验证码
export const registAdd = params => { return axios.post(`${address}/customers/regist/add`, params).then(res => res)  }; //注册
export const loginAdd = params => { return axios.post(`${address}/customers/account/login`, params).then(res => res)  }; //登录
export const passwordAdd = params => { return axios.post(`${address}/customers/password/reset`, params).then(res => res)  }; //重置密码
export const passwordCode = params => { return axios.post(`${address}/customers/password/getvcode`, params).then(res => res)  }; //重置密码验证码
export const binding = params => { return axios.post(`${address}/customers/binding/add`, params).then(res => res)  }; //银行卡绑定
export const bindingCode = params => { return axios.post(`${address}/customers/binding/getvcode`, params).then(res => res)  }; //银行卡绑定验证码
export const accountGet = params => { return axios.post(`${address}/customers/account/get`, params).then(res => res)  }; //账户信息


//tw--------------------------------------


// 公告
export const getlistNotice = params => { return axios.get(`${address}/api/infos/notice/getlist`, { params: params }).then(res => res) };

// 当前委托
export const positionGetlist = params => { return axios.post(`${address}/trades/position/getlist`, params).then(res => res)  }; //当前持仓
export const getPosition = params => { return axios.post(`${address}/trades/hisposition/get`, params).then(res => res)  }; //当前持仓详情
export const hispositionPosition = params => { return axios.post(`${address}/trades/hisposition/get`, params).then(res => res)  }; //历史持仓详情
export const hisposition = params => { return axios.post(`${address}/trades/hisposition/getlist`, params).then(res => res)  }; //历史委托
export const modifyPosition = params => { return axios.post(`${address}/trades/position/modify`, params).then(res => res)  }; //修改当前持仓
export const closePosition = params => { return axios.post(`${address}/trades/position/close`, params).then(res => res)  }; //平仓
export const setRenZhenImg = params => { return axios.post(`${address}/customers/setRenZhenImg`, params).then(res => res)  }; //平仓

export const recordGetlist = params => { return axios.post(`${address}/deposits/record/getlist`, params).then(res => res)  }; //OTC出金
export const withdrawsGetlist = params => { return axios.post(`${address}/withdraws/record/getlist`, params).then(res => res)  }; //OTC出金
// http://120.24.183.179:1500/api/
